import os

import django

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")
django.setup()


from books.models import *
from django.db.models import Model


local_dict = locals()

def get_model_list():
    for k in list(local_dict.keys()):
        c = local_dict[k]
        try:
            if issubclass(c, Model) and c != Model:
                yield c
        except TypeError:
            continue

# print(isinstance('a', str))
# print(isinstance('a', object))


# print(issubclass(Publisher, Model))